<template>
  <div>
    <div class="top">
      <van-nav-bar title="title" left-arrow @click-left="onClickLeft" />
      <div class="search">
        <div class="location" @click="getLocation">
          {{ city }}
          <van-icon class="icon" name="arrow-down">
            <span class="gun">|</span>
          </van-icon>
        </div>
        <van-search placeholder="请输入搜索关键词" />
        <van-icon name="guide-o" class="map" color="#fff" />
      </div>
    </div>
    <div class="home">
      <div class="collection-list">
        <div class="left">
          <img
            src="	http://liufusong.top:8080/uploads/upload_e9d9f25a750c1997b6531b2567d07303.png"
            alt=""
          />
        </div>
        <div class="right">
          <h3>123</h3>
          <div class="desc">123</div>
          <span class="tag"></span>
          <div class="price"><span class="num">123</span>&nbsp;元/月</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "lookup-page",
  components: {},
  props: {},
  data() {
    return {
      city: localStorage.getItem("city")
        ? localStorage.getItem("city")
        : "上海",
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    getLocation() {
      this.$router.push("/location");
    },
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped lang="less">
.search {
  .location {
    border-radius: 3px 0 0 3px;
    position: absolute;
    height: 34px;
    width: 64px;
    background-color: #f7f8fa;
    color: #333;
    z-index: 222;
    transform: translate(-50%, -50%);
    left: 20%;
    top: 3.5%;
    line-height: 34px;
    text-align: left;
    font-size: 14px;
    padding: 0 6px;
    .icon {
      font-size: 12px;
    }
  }
  .van-search {
    border-radius: 0 3px 3px 0;
    position: absolute;
    z-index: 222;
    padding: 0;
    transform: translate(-50%, -50%);
    left: 57%;
    top: 3.5%;
    width: 210px;
  }
}
.map {
  position: absolute;
  z-index: 222;
  transform: translate(-50%, -50%);
  left: 90%;
  top: 3%;
  width: 20px;
  height: 20px;
  font-size: 30px;
}

.gun {
  font-size: 20px;
  margin-left: 10px;
  color: #eee;
}
.van-nav-bar {
  background-color: #21b97a;
}
::v-deep .van-nav-bar__title {
  color: #fff;
  font-size: 18px;
}
::v-deep .van-nav-bar .van-icon {
  color: #fff;
}
::v-deep .van-index-bar__index {
  font-size: 14px;
  margin-top: 6px;
}
::v-deep .van-icon-arrow-left {
  font-size: 20px;
  left: -10px;
}
.collection-list {
  height: 100px;
  width: 100%;
  padding-top: 18px;
  // background-color: #ccc;
  display: flex;
  border-bottom: 1px solid #ddd;
  img {
    width: 106px;
    height: 80px;
    margin-left: 10px;
  }
  .right {
    padding-left: 12px;
    h3 {
      margin: 0;
      font-size: 15px;
      height: 22px;
      color: #394043;
      line-height: 22px;
    }
    .desc {
      font-size: 12px;
      color: #afb2b3;
      height: 22px;
      line-height: 20px;
    }
    .tag {
      display: block;
      width: 36px;
      height: 20px;
      padding: 0px 5px;
      background-color: #e1f5f8;
      color: #39bfcd;
      font-size: 12px;
      margin-right: 5px;
      line-height: 20px;
      border-radius: 3px;
    }
    .price {
      height: 23px;
      line-height: 23px;
      font-size: 12px;
      color: #fa5741;
      .num {
        font-size: 16px;
        font-weight: 700;
      }
    }
  }
}
</style>
